<?xml version="1.0" encoding="UTF-8"?>
<!--
To change this template, choose Tools | Templates
and open the template in the editor.
-->
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:f="http://java.sun.com/jsf/core"
      xmlns:ui="http://java.sun.com/jsf/facelets"
      xmlns:p="http://primefaces.org/ui">
    <h:form id="frmViewHospital">
        <f:view>
            <p:contextMenu for="dlgViewHospital">
                <p:menuitem value="New"
                            icon="ui-icon-search"
                            oncomplete="wgCreateHospital.show();"
                            update=":frmCreateHospital:dlgCreateHospital"
                            />
                <p:menuitem value="Edit"
                            icon="ui-icon ui-icon-arrowreturnthick-1-e"
                            oncomplete="wgEditHospital.show();"
                            update=":frmEditHospital:dlgEditHospital"
                            >
                </p:menuitem>
                <p:submenu label="Export" icon="ui-icon-extlink">
                    <p:submenu label="All Data">
                        <p:menuitem value="To Excel 2010"  ajax="false"  >
                            <p:dataExporter type="xls" target="dtViewHospital"  fileName="Hospital" />
                        </p:menuitem>
                        <p:menuitem value="To XML" ajax="false" >
                            <p:dataExporter type="xml" target="dtViewHospital" fileName="Hospital"/>
                        </p:menuitem>
                        <p:menuitem value="To PDF" ajax="false" >
                            <p:dataExporter type="pdf" target="dtViewHospital" fileName="Hospital"/>
                        </p:menuitem>
                    </p:submenu>
                    <p:submenu label="All Data in Page">
                        <p:menuitem value="To Excel 2010" ajax="false" >
                            <p:dataExporter type="xls" target="dtViewHospital" fileName="Hospital" pageOnly="true" />
                        </p:menuitem>
                        <p:menuitem value="To XML" ajax="false" >
                            <p:dataExporter type="xml" target="dtViewHospital" fileName="Hospital" pageOnly="true"/>
                        </p:menuitem>
                    </p:submenu>
                </p:submenu>
            </p:contextMenu> 
            <p:dialog id="dlgViewHospital"
                      widgetVar="wgViewHospital"
                      header="Hospital Information Management"
                      draggable="true"
                      showEffect="clip"
                      hideEffect="clip"
                      >
                <p:dataTable id="dtViewHospital"
                             value="#{hospitalManagement.list}"
                             rowKey="#{item.hospitalId}"
                             selection="#{hospitalManagement.selectHospital}"
                             selectionMode="single"
                             filteredValue="#{hospitalManagement.filteredList}"
                             paginator="true"
                             rows="5"
                             var="item">

                    <p:column
                              sortBy="#{item.hospitalName}"
                              filterBy="#{item.hospitalName}"
                              filterMatchMode="contains">
                        <f:facet name="header">
                            <h:outputText value="HospitalName"/>
                        </f:facet>
                        <h:outputText value="#{item.hospitalName}"/>
                    </p:column>
                    <p:column
                              sortBy="#{item.address}"
                              filterBy="#{item.address}"
                              filterMatchMode="contains">
                        <f:facet name="header">
                            <h:outputText value="Address"/>
                        </f:facet>
                        <h:outputText value="#{item.address}"/>
                    </p:column>
                    <p:column 
                              sortBy="#{item.city}"
                              filterBy="#{item.city}"
                              filterMatchMode="contains">
                        <f:facet name="header">
                            <h:outputText value="City"/>
                        </f:facet>
                        <h:outputText value="#{item.city}"/>
                    </p:column>
                    <p:column
                              sortBy="#{item.region}"
                              filterBy="#{item.region}"
                              filterMatchMode="contains">
                        <f:facet name="header">
                            <h:outputText value="Region"/>
                        </f:facet>
                        <h:outputText value="#{item.region}"/>
                    </p:column>
                    <p:column 
                              sortBy="#{item.postalCode}"
                              filterBy="#{item.postalCode}"
                              filterMatchMode="contains">
                        <f:facet name="header">
                            <h:outputText value="PostalCode"/>
                        </f:facet>
                        <h:outputText value="#{item.postalCode}"/>
                    </p:column>
                    <p:column 
                              sortBy="#{item.officePhone}"
                              filterBy="#{item.officePhone}"
                              filterMatchMode="contains">
                        <f:facet name="header">
                            <h:outputText value="OfficePhone"/>
                        </f:facet>
                        <h:outputText value="#{item.officePhone}"/>
                    </p:column>
                    <p:column 
                              sortBy="#{item.isLock}"
                              filterBy="#{item.isLock}"
                              filterMatchMode="contains">
                        <f:facet name="header">
                            <h:outputText value="IsLock"/>
                        </f:facet>
                        <h:outputText value="#{item.isLock}"/>
                    </p:column>
                </p:dataTable>



            </p:dialog>
        </f:view>


    </h:form>
</html>
